Namespace Forms.View

    Public Class ViewBase
        Inherits System.Windows.Forms.UserControl

#Region " Windows Form Designer generated code "

        Public Sub New()
            MyBase.New()

            'This call is required by the Windows Form Designer.
            InitializeComponent()

            'Add any initialization after the InitializeComponent() call
            Me.Dock = DockStyle.Fill
        End Sub

        'UserControl overrides dispose to clean up the component list.
        Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If Not (components Is Nothing) Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        'Required by the Windows Form Designer
        Private components As System.ComponentModel.IContainer

        'NOTE: The following procedure is required by the Windows Form Designer
        'It can be modified using the Windows Form Designer.  
        'Do not modify it using the code editor.
        <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
            components = New System.ComponentModel.Container
        End Sub

#End Region

#Region " Events "
        Public Event ViewCreated(ByVal sender As Object, ByVal e As EventArgs)
        Protected Overridable Sub OnViewCreated(ByVal e As EventArgs)
            RaiseEvent ViewCreated(Me, e)
        End Sub

        Public Event ViewDestroyed(ByVal sender As Object, ByVal e As EventArgs)
        Protected Overridable Sub OnViewDestroyed(ByVal e As EventArgs)
            RaiseEvent ViewDestroyed(Me, e)
        End Sub
#End Region

#Region " Overrided Methods "
        Protected Overrides Sub OnLoad(ByVal e As EventArgs)
            MyBase.OnLoad(e)
            OnViewCreated(EventArgs.Empty)
        End Sub
#End Region

#Region " Behaviour "
        Public Sub DestroyView()
            OnViewDestroyed(EventArgs.Empty)
        End Sub
#End Region

    End Class
End Namespace